//
//  CSNateRequest.h
//  CairnStory
//  www.cairnstory.com
//
//  Created by saturna on 11. 3. 25..
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>

@class CSNateOAuthResult;

@protocol CSNateRequestDelegate;

//  Nate Open API -- http://devsquare.nate.com/openApi/index

//================================================================================
// 미니홈피 API
//   미니홈피 공통
//     - 폴더목록 보기			: CSNateRequestRetrieveFolderList
//     - 메뉴 오픈여부 확인		: CSNateRequestRetrieveMenuOpen
//   사진첩 게시물
//     - 목록보기				: CSNateRequestRetrievePhotoList
//     - 상세보기				: CSNateRequestRetrievePhoto
//     - 작성하기				: CSNateRequestRegisterPhotoMessage
//     - 사진 업로드			: CSNateRequestUploadPhoto
//   다이어리 게시물
//     - 목록보기				: CSNateRequestRetrievePhotoList
//     - 상세보기				: CSNateRequestRetrievePhoto
//     - 작성하기				: CSNateRequestRegisterPhoto
//   방명록 게시물
//     - 목록보기				: CSNateRequestRetrieveVisitBookList
//     - 작성하기				: CSNateRequestRetrieveVisitBook
//================================================================================
extern NSString* const CSNateRequestRetrieveFolderList;
extern NSString* const CSNateRequestRetrieveMenuOpen;

extern NSString* const CSNateRequestRetrievePhotoList;
extern NSString* const CSNateRequestRetrievePhoto;
extern NSString* const CSNateRequestRegisterPhotoMessage;
extern NSString* const CSNateRequestUploadPhoto;

extern NSString* const CSNateRequestRetrieveMyDiaryList;
extern NSString* const CSNateRequestRetrieveMyDiary;
extern NSString* const CSNateRequestRegisterMyDiary;

extern NSString* const CSNateRequestRetrieveVisitBookList;
extern NSString* const CSNateRequestRegisterVisitBook;


//================================================================================
// 일촌 API
//   - 관심일촌 목록보기(간단)	: CSNateRequestRetrieveOnedegListIds
//   - 관심일촌 목록보기		: CSNateRequestRetrieveOnedegList
//   - 프로필 조회하기			: CSNateRequestRetrieveMemProfile
//================================================================================
extern NSString* const CSNateRequestRetrieveOnedegListIds;
extern NSString* const CSNateRequestRetrieveOnedegList;
extern NSString* const CSNateRequestRetrieveMemProfile;


//================================================================================
// 네이트온 API
//   내 프로필
//     - 내 프로필 조회		: CSNateRequestNateOnGetProfile
//     - 내 대화명 수정		: CSNateRequestNateOnUpdateNickname
//     - 내 프로필 사진 수정	: CSNateRequestNateOnUpdateProfileImage
//   네이트온 친구 네트워크
//     - 친구목록 조회			: CSNateRequestNateOnGetBuddyList
//     - 친구정보 조회			: CSNateRequestNateOnGetBuddyProfiles
//     - 친구 추가			: CSNateRequestNateOnRequestBuddy
//   커뮤니케이션
//     - 쪽지 발송			: CSNateRequestNateOnSendNote
//     - 메일 발송			: CSNateRequestNateOnSendMail
//================================================================================
extern NSString* const CSNateRequestNateOnGetProfile;
extern NSString* const CSNateRequestNateOnUpdateNickname;
extern NSString* const CSNateRequestNateOnUpdateProfileImage;

extern NSString* const CSNateRequestNateOnGetBuddyList;
extern NSString* const CSNateRequestNateOnGetBuddyProfiles;
extern NSString* const CSNateRequestNateOnRequestBuddy;

extern NSString* const CSNateRequestNateOnSendNote;
extern NSString* const CSNateRequestNateOnSendMail;

//================================================================================
// (C)로그 API
//   (C)로그 공통
//     - 정보 조회			: CSNateRequestCLogGetProfile
//   노트 게시물
//     - 목록보기				: CSNateRequestCLogGetNoteList
//     - 상세보기				: CSNateRequestCLogGetNote
//     - 작성하기				: CSNateRequestCLogAddNote
//     - 삭제하기				: CSNateRequestCLogDeleteNote
//     - 공개설정 변경			: CSNateRequestCLogPutNoteOpenType
//     - 파일(이미지) 등록		: CSNateRequestCLogUploadPhoto
//================================================================================
extern NSString* const CSNateRequestCLogGetProfile;
extern NSString* const CSNateRequestCLogGetNote;
extern NSString* const CSNateRequestCLogAddNote;
extern NSString* const CSNateRequestCLogDeleteNote;
extern NSString* const CSNateRequestCLogUpdateNoteOpenType;
extern NSString* const CSNateRequestCLogUploadPhoto;

//================================================================================
// 커넥팅 API
//   - Create Post			: CSNateRequestConnectCreatePost
//   - Share Post			: CSNateRequestConnectSharePost
//================================================================================
extern NSString* const CSNateRequestConnectCreatePost;
extern NSString* const CSNateRequestConnectSharePost;

typedef enum
{
	CSNateRequestOutputTypeXML = 1,
	CSNateRequestOutputTypeJSON = 2
}
CSNateRequestOutputType;


@interface CSNateRequest : NSObject
{
	CSNateOAuthResult* m_oauth;
	NSMutableData* m_responseData;
	NSString* m_methodName;

	NSUInteger m_nateTag;
	CSNateRequestOutputType m_outputType;
	id<CSNateRequestDelegate,NSObject> m_delegate;

	NSInteger m_responseCode;
}

@property (nonatomic,assign) NSUInteger nateTag;
@property (nonatomic,assign) id<CSNateRequestDelegate,NSObject> delegate;


- (id)initWithNateOAuthResult:(CSNateOAuthResult*)oauth;

#pragma mark -
- (void)requestWithMethodName:(NSString*)methodName
					andParams:(NSMutableDictionary*)params
				andHttpMethod:(NSString*)httpMethod
				andOutputType:(CSNateRequestOutputType)outputType;

- (void)requestWithMethodName:(NSString*)methodName
					andParams:(NSMutableDictionary*)params
				andOutputType:(CSNateRequestOutputType)outputType;

- (void)multipartRequestWithMethodName:(NSString*)methodName
							 andParams:(NSMutableDictionary*)params
						 andOutputType:(CSNateRequestOutputType)outputType;

#pragma mark -
- (void)requestWithMethodName:(NSString*)methodName
					andParams:(NSMutableDictionary*)params
				andHttpMethod:(NSString*)httpMethod;

- (void)requestWithMethodName:(NSString*)methodName
					andParams:(NSMutableDictionary*)params;

- (void)multipartRequestWithMethodName:(NSString*)methodName
							 andParams:(NSMutableDictionary*)params;

@end

